<?php
	use yii\helpers\Html;
	use yii\helpers\Url;
	use yii\widgets\ActiveForm;
	use yii\widgets\LinkPager;
?>

<div class="page-header">
	<h1>
		房源管理
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			高级查询
		</small>
	</h1>
	
</div>
<style>
	.list {
		list-style: none;
		width:100%;
	}
	.fl {
		float: left;
	}
	.clearfix:before,.clearfix:after {
	    content: "";
	    display: table;
	}
	.clearfix:after {
	    clear: both;
	}
	.clearfix {
	    *zoom:1, 
	}
	.list .lou {
		width: 20%;
	}
	.list .item {
		width: 40%;
	}
	.list .lou input {
		width: 50%;
	}
	.list .item input {
		width: 26%;
	}
	.sub li {
		margin-left: 80%;
	}
	.sub li .bttn {
		width: 36%;
	    height: 36px;
	    color: #fff;
	    font-size: 1.2em;
	    background: #438EB9;
	    border: none;
	}
</style>

<div class="row">

	<div class="col-xs-12">

		<?php $form = ActiveForm::begin([
			'enableClientValidation' => true,
			'method' => 'post',
			'options' => ['class' => 'form-search'],
		])?>
		<ul class="list clearfix">
			<li class="lou fl">
				<span>楼层：<input name="Room[tier]" type="text" required></span>
			</li>
			<li class="item fl">
				<span>建筑面积：<input name="Room[Aarea]" type="text">--<input name="Room[Earea]" type="text"></span>
			</li>
			<li class="item fl">
				<span>总价：<input name="Room[Atotalprice]" type="text">--<input name="Room[Etotalprice]" type="text"></span>
			</li>
		</ul>
		<ul class="list sub">
			<li><input class="bttn" type="submit" value="搜索"></li>
		</ul>

		<?php ActiveForm::end();?>

		<table id="simple-table" class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th class="center" >序号</th>
					<th class="center" >楼号</th>
					<th class="center">单元</th>
					<th class="center" >层数</th>
					<th class="center" >房间号</th>
					<th class="center" >面积</th>
					<th class="center" >总价</th>
				</tr>
			</thead>
				<?php $i="1"?>
				<?php if(isset($model)): foreach($model as $mod):?>
				<tr>
					<td><?php echo $i;?></td>
					<td><?php echo $mod->floorId;?></td>
					<td><?php echo $mod->unitName;?></td>
					<td><?php echo $mod->tier;?></td>
					<td><?php echo $mod->roomId;?></td>
					<td><?php echo $mod->area;?></td>
					<td><?php echo $mod->totalPrice;?></td>
				</tr>
				<?php $i++;?>
				<?php endforeach;endif;?>
			<tbody>
				
			</tbody>
			
		</table>
		<?php if(is_object($pages)):?>
			<?= LinkPager::widget(['pagination'=>$pages]);?>
		<?php endif;?>

	</div><!-- /.span -->
</div><!-- /.row -->
<script src="./ace/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
	function del(id){
		if(window.confirm('确认要删除么?')){
			window.location.href = "<?php echo Url::toRoute(['content/del'])?>&id="+id;
		}
	}
	$(function(){
		$("#J_Change").bind('change',function(){


			$('form')[0].submit();
		})
	})
</script>
<div class="hr hr-18 dotted hr-double"></div>